%% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*-
%% ex: ft=erlang ts=4 sw=4 et
{sys, [
       {lib_dirs, ["../deps", "../deps/riak_search/apps"]},
       {rel, "riak", "1.4.2",
        [
         kernel,
         stdlib,
         lager,
         sasl,
         public_key,
         ssl,
         riak_sysmon,
         os_mon,
         crypto,
         runtime_tools,
         erlang_js,
         mochiweb,
         webmachine,
         basho_stats,
         bitcask,
         riak_core,
         riak_pipe,
         riak_kv,
         riak_search,
         riak_api,
         cluster_info,
         riak_control,
         erlydtl,
         {folsom, load}
        ]},
       {rel, "start_clean", "",
        [
         kernel,
         stdlib
        ]},
       {boot_rel, "riak"},
       {profile, embedded},
       {excl_sys_filters, ["^bin/.*",
                           "^erts.*/bin/(dialyzer|typer)"]},
       {excl_archive_filters, [".*"]},
       {app, cluster_info, [{incl_cond, include}]},
       {app, erlang_js, [{incl_cond, include}]},
       {app, ebloom, []},
       {app, riaknostic, [{incl_cond, include}]},
       {app, bitcask, [{incl_cond, include}]},
       {app, riak_core, [{incl_cond, include}]},
       {app, riak_pipe, [{incl_cond, include}]},
       {app, riak_kv, [{incl_cond, include}]},
       {app, riak_search, [{incl_cond, include}]},
       {app, eper, [{incl_cond, include}]},
       {app, sasl, [{incl_cond, include}]},
       {app, syslog, [{incl_cond, include}]},
       {app, lager_syslog, [{incl_cond, include}]},
       {app, lager, [{incl_cond, include}]},
       {app, riak_control, [{incl_cond, include}]},
       {app, riak_api, [{incl_cond, include}]},
       {app, folsom, [{incl_cond, include}]}
      ]}.


{target_dir, "riak"}.

{overlay_vars, "vars.config"}.

{overlay, [
           {mkdir, "data/ring"},
           {mkdir, "log"},

           %% Copy base files for starting and interacting w/ node
           {copy, "../deps/node_package/priv/base/erl",
                  "{{erts_vsn}}/bin/erl"},
           {copy, "../deps/node_package/priv/base/nodetool",
                  "{{erts_vsn}}/bin/nodetool"},
           {template, "../deps/node_package/priv/base/runner",
                  "bin/riak"},
           {template, "../deps/node_package/priv/base/env.sh",
                  "lib/env.sh"},
           {template, "../deps/node_package/priv/base/app_epath.sh",
                  "lib/app_epath.sh"},

           %% Copy config files
           {template, "files/app.config", "etc/app.config"},
           {template, "files/vm.args", "etc/vm.args"},

           %% Copy SSL Certs
           {template, "files/cert.pem", "etc/cert.pem"},
           {template, "files/key.pem", "etc/key.pem"},

           %% Copy additional bin scripts
           {template, "files/riak-admin", "bin/riak-admin"},
           {template, "files/riak-debug", "bin/riak-debug"},
           {template, "files/search-cmd", "bin/search-cmd"},

           {mkdir, "lib/basho-patches"},
           {copy, "../ebin/etop_txt.beam", "lib/basho-patches"}
          ]}.
